#include "TerminalLooper.h"

#include <string>
using std::string;

TerminalLooper::TerminalLooper() : mInput(cin), mOutput(cout) {

}

TerminalLooper::TerminalLooper(istream& input, ostream& output) : mInput(input), mOutput(output) {

}

TerminalLooper::~TerminalLooper() {

}

void TerminalLooper::runLoop(Console& console) {
	string line;
	while (mOutput << ">>", std::getline(mInput, line), mInput) {
		mOutput << "--" << line << endl;
		console.queueCommand(line);
		console.run();
	}
}

